<%--
  Created by IntelliJ IDEA.
  User: liujie
  Date: 2016/9/1
  Time: 14:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title></title>
</head>
<body>
<div class="pageHeader">
    <form rel="pageForm" onsubmit="return navTabSearch(this);"
          action="<c:url value='/survey/index'/>" method="post">
        <div class="searchBar">
            <ul>
                <li style="float: left; line-height: 25px;">
                    <label>名称：</label>
                    <input name="keywords" type="text" value="${query.keywords}" placeholder="请输入问卷名称检索"
                           style="width: 230px; font-family: '微软雅黑 sans-serif serif';"/>
                </li>
                <li>
                    <div class="buttonActive" style="margin-left: 5px;">
                        <div class="buttonContent">
                            <button type="submit">查找</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent" style="padding-top: 1px;">
    <div class="panelBar">
        <ul class="toolBar" style="float: left;display: inline-block;">
            <li><a class="add" href="<c:url value='/survey/view/-1'/>" target="dialog" width="500" height="240" mask="true"
                   resizable="false" maxable="false"><span>添加问卷</span></a></li>
            <li class="line"></li>
            <li><a class="delete" href="<c:url value='/survey/delete/{sel_id}'/>" target="ajaxDel" title="是否确认删除当前问卷？"><span>删除</span></a></li>
            <li class="line"></li>
            <li><a class="edit" href="<c:url value='/survey/view/{sel_id}'/>" target="dialog" width="500" height="240" mask="true" resizable="false"
                   maxable="false" title="编辑" ><span>编辑</span></a></li>
            <li class="line"></li>
            <li><a class="icon" href="<c:url value='/api/survey/index/{sel_id}'/>"
                   target="navTab" rel="survey-preview" external="true"><span>预览</span></a></li>
        </ul>
    </div>
    <table class="table" width="100%" layoutH="110">
        <thead>
        <tr>
            <th width="20" align="center">序号</th>
            <th width="80">问卷名称</th>
            <th width="50">问卷ID</th>
            <th width="50">创建时间</th>
            <th width="150">问卷说明</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="survey" items="${pager.list}" varStatus="vs">
            <tr target="sel_id" rel="${survey.id}">
                <td>${vs.count+(pager.pageNum-1)*pager.numPerPage}</td>
                <td>${survey.name}</td>
                <td>${survey.id}</td>
                <td><fmt:formatDate value="${survey.createtime}" pattern="yyyy-MM-dd HH:mm"/></td>
                <td>${survey.note}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示&nbsp;</span> <select id="cob_ps" class="combox"
                                          name="numPerPage"
                                          onchange="navTabPageBreak({numPerPage:this.value})">
            <option value="20" <c:if test="${pager.numPerPage == 20}"> selected="selected"</c:if>>20</option>
            <option value="50" <c:if test="${pager.numPerPage == 50}"> selected="selected"</c:if>>50</option>
            <option value="100" <c:if test="${pager.numPerPage == 100}"> selected="selected"</c:if>>100</option>
            <option value="200" <c:if test="${pager.numPerPage == 200}"> selected="selected"</c:if>>200</option>
        </select> <span>条，共${pager.total}条</span>
        </div>
        <div class="pagination" targetType="navTab"
             totalCount="${pager.total}" numPerPage="${pager.numPerPage}"
             pageNumShown="10" currentPage="${pager.pageNum}"></div>
    </div>
    <form id="pagerForm" method="post" action="<c:url value='/survey/index'/>">
        <input type="hidden" name="pageNum" value="${pager.pageNum}"/>
        <input type="hidden" name="handler" value="${query.handler}"/>
        <input type="hidden" name="numPerPage" value="${pager.numPerPage}"/>
        <input type="hidden" name="orderField" value="${query.orderField}"/>
        <input type="hidden" name="orderDirection" value="${query.orderDirection}"/>
        <input type="hidden" name="keywords" value="${query.keywords}"/>
    </form>
</div>
</body>
</html>

